import java.util.*;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-10-01
 * Time: 0:34
 */

/**
 * 除2！
 */
public class NotEquals {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),k = in.nextInt();

        //创建大根堆
        PriorityQueue<Integer> heap = new PriorityQueue<>((a,b) -> {
            return b-a;
        });

        //把偶数丢进大根堆，获取偶数大根堆的和
        long sum = 0,num;
        for(int i = 0; i < n; i++){

            num = in.nextLong();
            sum += num;

            if(num % 2 == 0) {
                heap.offer((int)num);
            }
        }


        //拿出堆顶元素，除2，从sum中减掉减小的值
        while(!heap.isEmpty() && k-- != 0){

            long t = heap.poll() / 2;
            sum -= t;

            if(t % 2 == 0) heap.offer((int)t);
        }
        System.out.print(sum);
    }
}
